﻿@model IEnumerable<RedSand.Site.Models.CustomPcInfo>
<div class="panel">
    <div class="panel-header">
        <span>Custom pc manager</span>
    </div>
    <div class="panel-content">
        <div class="panel-toolbar">
        <ul>
            <li>
                @Ajax.ActionLink("Add product", "create", null, AdminAjaxOptions.GetForm, new { @class = "btn-create" })
            </li>
            <li>
                <a href="#" class="btn-search">Search</a>
            </li>
            <li>
                @Ajax.ActionLink("Delete all selected", "delete", null, AdminAjaxOptions.DeleteRecords, new { @class = "btn-deletes" })
            </li>
        </ul>
    </div>
        <div class="panel-searchbox">
            @using (Ajax.BeginForm("List", AdminAjaxOptions.Search))
            {
                
                <div class="form-cell width-auto">
                    <input type="submit" value="Search" class="button-small" />
                </div>
                <div class="clear">
                </div>
            }
        </div>
        @if (Model == null)
        {
            <div class="message warning">Data Empty</div>
        }
        else
        {
            <table class="table-list">
                <thead>
                    <tr>
                        <th class="width-25"><input type="checkbox" /></th>
                        <th>Name</th>
                        <th>Category</th>
                        <th>Price</th>
                        <th class="center width-80">Status</th>
                        <th class="center width-80">Control</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                <input value="@item.CustomPcID" type="checkbox" />
                            </td>
                            <td>
                                @item.Name
                            </td>
                            <td>
                                @Html.Action("GetName", "Category", new { id = item.CategoryID })
                            </td>
                            <td>
                                @item.Price
                            </td>
                            <td class="center">
                                @DropDownListHelper.GetStatusString(item.Status)
                            </td>
                            <td class="center">
                                @Ajax.ActionLink("Edit", "edit", new { id = item.CustomPcID }, AdminAjaxOptions.GetForm, new { @class = "btn-edit", title = "Edit" })
                                @Ajax.ActionLink("Delete", "delete", new { id = item.CustomPcID }, AdminAjaxOptions.DeleteRecord, new { @class = "btn-delete", title = "Delete" })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
            <div class="pager-wrapper">
                @Ajax.Pager((int)ViewBag.TotalRecord, AdminAjaxOptions.Paging)
                <div class="pager-loading-panel"></div>
            </div>
        }
    </div>
</div>
